<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<input type="text" class="num1">
	<input type="text" class="sign">
	<input type="text" class="num2">
	<input type="text" class="rel">
	<input type="button" value="计算" class="ppap">
	<script src="../JQuery/jquery-1.11.1.js"></script>
	<script>
		$(".ppap").click(function(){
			var NUM1 = Number($(".num1").val());
			var SIGN = $(".sign").val();
			var NUM2 = Number($(".num2").val());
			var REL = "";
			console.log(NUM1,SIGN,NUM2);
			//if (SIGN=="+") {
			//	REL= NUM1+NUM2
			//}else if (SIGN=="-") {
			//	REL= NUM1-NUM2
			//}else if (SIGN=="*") {
			//	REL= NUM1*NUM2
			//}else if (SIGN=="/") {
			//	REL= NUM1/NUM2
			//}
			switch(SIGN){
				case "+":REL = NUM1 + NUM2;break;
				case "-":REL = NUM1 - NUM2;break;
				case "*":REL = NUM1 * NUM2;break;
				case "/":REL = NUM1 / NUM2;break;
			}
			$(".rel").val(REL);
		})
	</script>
</body>
</html>